<template>
    <div class="views-container">
        <el-card style="width: 350px">
            <div class="item-box">
                <span>{{ title }}</span>
                <div>
                    <span class="times">{{ times }}</span>次
                </div>
                <div class="percent">
                    <span>周同比{{ WeekPercent }}%</span>
                    <span v-if="WeekPercent > 0" class="triangle"></span>
                    <span v-else class="inverted-triangle"></span>
                    <span class="day-percent">日同比{{ DayPercent }}%</span>
                    <span v-if="DayPercent > 0" class="triangle"></span>
                    <span v-else class="inverted-triangle"></span>
                </div>
                <div class="horizontal-line"></div>
                <span>日均访问量{{ AveragePerDay }}次</span>
            </div>
        </el-card>
    </div>
</template>

<script>
export default {
    props: {
        title: String,
        times: String,
        WeekPercent: Number,
        DayPercent: Number,
        AveragePerDay: String,
    },
}
</script>

<style scoped>
.el-main span,div {
    line-height: 35px;
}
.views-container {
    width: 300px;
}
.item-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.horizontal-line {
    border-bottom: 1px solid black;
    width: 100%;
}
.percent {
    font-size: 14px;
}
.triangle{
    display: inline-block;
    width: 0px;
    height: 0px;
    border: 5px solid transparent;
    /* border-color: red blue green yellow; */
    border-top:0px ;
    border-bottom: 10px solid red;
}
.inverted-triangle{
    display: inline-block;
    width: 0px;
    height: 0px;
    border: 5px solid transparent;
    border-top: 10px solid green;
    border-bottom:0px ;
}
.times{
    font-size: 30px;
}
.day-percent{
    margin-left: 10px;
}
</style>